import { defineStore } from 'pinia'
import { ref } from 'vue'
import { getHomeBannerListApi } from '@/services/home'

// 首页数据
export const useHomeStore = defineStore('home', () => {
  //轮播图数据
  const bannerList = ref<AnyObject>()

  const getBannerList = async () => {
    const res = await getHomeBannerListApi({ distributionSite: 1 })
    bannerList.value = res.result
    // console.log(bannerList.value)
  }

  return {
    bannerList,
    getBannerList,
  }
})
